import re


def simpleReplace(origin):
    return origin.replace("亿", "").replace("万", "").replace("%", "")

def remove_chinese_keep_numbers(text):
    # 匹配非数字字符并替换为空
    return re.sub(r'[^\d]', '', text)

def get_number(text):
    number = ''
    if(text == '--'):
        return None
    else:
        number =  re.sub(r'[^\d.]', '', text)        # 干掉中文
    return None if number == '' else number


def test():
    str1 = '亏损'
    str2 = '43.67'
    str3 = '--'
    str4 = '123亿'
    print(remove_chinese_keep_numbers(str1))
    print(remove_chinese_keep_numbers(str2))
    print(remove_chinese_keep_numbers(str1) == '')
    print(remove_chinese_keep_numbers(str1) == None)
    print(str2 == '123')

    print(get_number(str1))
    print(get_number(str2))
    print(get_number(str3))
    print(get_number(str4))

# test()


